/**
 * 
 */
package cn.mibcxb.java.dolphin.exception;

/**
 * @author CXB
 * 
 */
public class DataException extends DolphinException {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5624313971672593970L;
	private ErrorType mType;

	public DataException(ErrorType mType) {
		super();
		this.mType = mType;
	}

	@Override
	public String getMessage() {
		String msg = "";
		switch (mType) {
		case NULL:
			msg = "Data can not be NULL!";
			break;
		case OVERFLOW:
			msg = "Data is too long!";
			break;
		default:
			msg = "Unknow error!";
			break;
		}
		return msg;
	}

	public enum ErrorType {
		NULL, OVERFLOW
	}
}
